import React, { useState } from 'react'
import Header from '../layout/Header'
import Search from '../layout/Search'
import Main from '../layout/Main'
import { Button } from 'antd'
export default function PurchaseReturnsAndShipments() {
  const [status, SetStatus] = useState(7)
  const [searchHeight, SetsearchHeight] = useState('150px')
  const [columns, SetColumns] = useState([
    {
      title: '采购单',
      dataIndex: 'purchaseorder',
      key: 'purchaseorder',
    },
    {
      title: '状态',
      dataIndex: 'status',
      key: 'status',
    },
    {
      title: '制表时间',
      dataIndex: 'tabletime',
      key: 'tabletime',
    },
    {
      title: '审核时间',
      dataIndex: 'audittime',
      key: 'audittime',
    },
    {
      title: '审核时效',
      dataIndex: 'reviewtimelimit',
      key: 'reviewtimelimit',
    },
    {
      title: '采购入库单',
      dataIndex: 'purchaseReceipt',
      key: 'purchaseReceipt',
    },
    {
      title: '入库时间',
      dataIndex: 'storagetime',
      key: 'storagetime',
    },
    {
      title: '入库时效',
      dataIndex: 'storagetimelimit',
      key: 'storagetimelimit',
    },

    {
      title: '供应商',
      dataIndex: 'purchasingfreight',
      key: 'purchasingfreight',
    },
    {
      title: '备注',
      dataIndex: 'remark',
      key: 'remark',
    },
  ])
  const [list, SetList] = useState([
    {
      id: 1,
      purchaseorder: "CG2035060923",
      status: 1,
      tabletime: '2025-06-09 10:00:00',
      audittime: '2035-09-19 9:39:39',
      reviewtimelimit: '0天3时45分',
      purchaseReceipt: 'CO2035060923',
      storagetime: '2035-09-19 9:39:39',
      storagetimelimit: '0天3时45分',
      purchasingfreight: '聚沙商贸',
      remark: '-'
    },
    {
      id: 2,
      purchaseorder: "CG2035060923",
      status: 1,
      tabletime: '2025-06-09 10:00:00',
      audittime: '2035-09-19 9:39:39',
      reviewtimelimit: '0天3时45分',
      purchaseReceipt: 'CO2035060923',
      storagetime: '2035-09-19 9:39:39',
      storagetimelimit: '0天3时45分',
      purchasingfreight: '聚沙商贸',
      remark: '-'
    },
    {
      id: 3,
      purchaseorder: "CG2035060923",
      status: 1,
      tabletime: '2025-06-09 10:00:00',
      audittime: '2035-09-19 9:39:39',
      reviewtimelimit: '0天3时45分',
      purchaseReceipt: 'CO2035060923',
      storagetime: '2035-09-19 9:39:39',
      storagetimelimit: '0天3时45分',
      purchasingfreight: '聚沙商贸',
      remark: '-'
    },
    {
      id: 4,
      purchaseorder: "CG2035060923",
      status: 1,
      tabletime: '2025-06-09 10:00:00',
      audittime: '2035-09-19 9:39:39',
      reviewtimelimit: '0天3时45分',
      purchaseReceipt: 'CO2035060923',
      storagetime: '2035-09-19 9:39:39',
      storagetimelimit: '0天3时45分',
      purchasingfreight: '聚沙商贸',
      remark: '-'
    },
    {
      id: 5,
      purchaseorder: "CG2035060923",
      status: 1,
      tabletime: '2025-06-09 10:00:00',
      audittime: '2035-09-19 9:39:39',
      reviewtimelimit: '0天3时45分',
      purchaseReceipt: 'CO2035060923',
      storagetime: '2035-09-19 9:39:39',
      storagetimelimit: '0天3时45分',
      purchasingfreight: '聚沙商贸',
      remark: '-'
    },
    {
      id: 6,
      purchaseorder: "CG2035060923",
      status: 1,
      tabletime: '2025-06-09 10:00:00',
      audittime: '2035-09-19 9:39:39',
      reviewtimelimit: '0天3时45分',
      purchaseReceipt: 'CO2035060923',
      storagetime: '2035-09-19 9:39:39',
      storagetimelimit: '0天3时45分',
      purchasingfreight: '聚沙商贸',
      remark: '-'
    },
    {
      id: 7,
      purchaseorder: "CG2035060923",
      status: 1,
      tabletime: '2025-06-09 10:00:00',
      audittime: '2035-09-19 9:39:39',
      reviewtimelimit: '0天3时45分',
      purchaseReceipt: 'CO2035060923',
      storagetime: '2035-09-19 9:39:39',
      storagetimelimit: '0天3时45分',
      purchasingfreight: '聚沙商贸',
      remark: '-'
    },
    {
      id: 8,
      purchaseorder: "CG2035060923",
      status: 1,
      tabletime: '2025-06-09 10:00:00',
      audittime: '2035-09-19 9:39:39',
      reviewtimelimit: '0天3时45分',
      purchaseReceipt: 'CO2035060923',
      storagetime: '2035-09-19 9:39:39',
      storagetimelimit: '0天3时45分',
      purchasingfreight: '聚沙商贸',
      remark: '-'
    }
  ])
  const [pageSize, SetPageSize] = useState(5)
  const [page, SetPage] = useState(1)
  const paginationConfing = {
    page: page,
    total: list.length,
    pageSize: pageSize,
    showSizeChanger: true,
    pageSizeOptions: ['2', '3', '4', '5'],
    onchange: (page: number) => {
      SetPage(page)
    },
    onShowSizeChange: (current: number, size: number) => {
      SetPageSize(size)
      SetPage(current)
    }
  }
  return (
    <div>
      <Header status={status} />
      <Search status={status} searchHeight={searchHeight} />
      <Main status={status} columns={columns} list={list} paginationConfing={paginationConfing} />
    </div>
  )
}
